#!/usr/bin/env python

from docutils.io import StringInput
from docutils import core

input_string = """
This is a paragraph.  It's quite
short.

   This paragraph will result in an indented block of
   text, typically used for quoting other text.

This is another one.

* a bullet point using "*"

  - a sub-list using "-"

      + yet another sub-list

        - another item
"""

overrides = {'input_encoding': 'iso8559',
             'doctitle_xform': 'test title',
             'initial_header_level': 2}

parts = core.publish_parts(
    source=input_string, source_path='/tmp/foo!',
    destination_path=None,
    writer_name='html', settings_overrides=overrides)

print parts['fragment']

